package cn.lili.controller.feign;

import cn.lili.modules.goods.client.GoodsStatisticsClient;
import cn.lili.modules.goods.entity.dto.GoodsNumSearchParams;
import cn.lili.modules.goods.service.GoodsStatisticsService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author paulG
 * @since 2022/6/28
 **/
@RestController
@RequiredArgsConstructor
public class GoodsStatisticsFeignController implements GoodsStatisticsClient {

    private final GoodsStatisticsService goodsStatisticsService;

    @Override
    public long goodsNum(GoodsNumSearchParams searchParams) {
        return goodsStatisticsService.goodsNum(searchParams.getGoodsMarketEnum(), searchParams.getGoodsAuthEnum(), searchParams.getStoreId());
    }

    @Override
    public long todayUpperNum() {
        return goodsStatisticsService.todayUpperNum();
    }

    @Override
    public long goodsNumByUrban(GoodsNumSearchParams searchParams) {
        return goodsStatisticsService.goodsNumByUrban(searchParams.getGoodsMarketEnum(), searchParams.getGoodsAuthEnum(), searchParams.getStoreId());
    }
}
